//
// Created by benxb on 2022/3/6.
//

#ifndef BENXDB_DATA_READER_H
#define BENXDB_DATA_READER_H


#include <string>
#include <vector>
#include <fstream>


class DataReader {
public:
    ~DataReader() = default;
    explicit DataReader(const std::string& data_dir);

    virtual void ReadSweep(std::vector<float>& x_arr, std::vector<float>& y_arr, std::vector<float>& z_arr) = 0;

    bool HasMoreSweep();

    long long int ReadTimestamp();

    static DataReader* GetReader(const std::string& reader_name, const std::string& data_dir);

protected:
    std::fstream data_io_;
    std::string data_dir_;
    std::vector<std::string> data_files_;
    int next_index = 0;
    std::fstream timestamp_file_;
};

#endif //BENXDB_DATA_READER_H
